<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>
        // 定时任务    ajax     事件

        // 回调函数
        // promise   
        // *
        // async


        // promise.all([p1, p2, p3])

        const p1 = new Promise((resolve, reject) => {
            console.log('hello1')
            resolve('hello1');
            
        }).then(result => result);

        const p2 = new Promise((resolve, reject) => {
            // console.log('hello2')
            reject('hello2');
        }).then(result => result)

        const p3 = new Promise((resolve, reject) => {
            // console.log('hello3')
            resolve('hello3');
        }).then(result => result);

        Promise.all([p1, p2, p3])
            // .then(result => console.log(44))
            .catch(e => console.log(e));

        Promise.race([p1, err])
    </script>
</body>

</html>